package com.vicente.managerdemo.controller;


import com.vicente.managerdemo.common.ResultBean;
import com.vicente.managerdemo.service.DemoService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

/**
 * @author shiweisen
 * @since 2018-11-28
 */
@RestController
@RequestMapping("demo")
public class DemoController {

    private static final Logger logger = LoggerFactory.getLogger(DemoController.class);

    @Resource
    private DemoService demoService;

    @RequestMapping("test")
    public ResultBean test(){
        System.out.println("test....................");
        return ResultBean.getSuccess("test.........................");
    }

    @RequestMapping("queryById")
    public ResultBean queryById(String id) {
        // ...省略业务逻辑代码...
        logger.info( " queryById, param is:{}",id);
        return ResultBean.getSuccess(demoService.getDataStr(id));
    }

}
